<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Ajax 首页</title>
</head>
<body>
<div id="app">
    <h1>restController 测试</h1>
    <button @click="testAjax">ajax</button>
    <br>
    <button @click="testAxios">axios</button>
</div>
<script th:src="@{/js/vue.js}" type="text/javascript"></script>
<script th:src="@{/js/axios.min.js}"></script>
<script type="text/javascript">
var vue=new Vue({
    el:"#app",
    methods:{
        testAjax(){
            axios.post("/SpringMVC/test/rest/ajax").then(response=>{
                console.log(response.data)
            })
        },
        testAxios(){
            axios.post("/SpringMVC/test/rest/axios").then(res=>{
                console.log(res.data)
            })
        }
    }
})
</script>
</body>
</html>